
<%@page import="qldc.pm.qtht.dmdc.service.TrangThaiHonNhanLocalServiceUtil"%>
<%@page import="qldc.pm.qtht.dmdc.model.TrangThaiHonNhan"%>
<%@page import="qldc.pm.csdl.cd90.service.TinhTrangHonNhanLocalServiceUtil"%>
<%@page import="qldc.pm.csdl.cd90.model.TinhTrangHonNhan"%>
<%@page import="qldc.pm.qtht.dmdc.service.QuanHeGiaDinhLocalServiceUtil"%>
<%@page import="qldc.pm.qtht.dmdc.model.QuanHeGiaDinh"%>
<%@page import="qldc.pm.csdl.cd90.service.QuanHeVoiChuHoLocalServiceUtil"%>
<%@page import="qldc.pm.csdl.cd90.model.QuanHeVoiChuHo"%>
<%@page import="qldc.pm.csdl.cd90.service.CongDanDTOLocalServiceUtil"%>
<%@page import="qldc.pm.csdl.cd90.model.dto.CongDanDTO"%>
<%@ include file="../../init.jsp"%>

<%
	String soDinhDanhCaNhan = ParamUtil.getString(request, "soDinhDanhCaNhan");
	System.out.println("tinh trang hon nhan: soDinhDanhCaNhan: >>>"+soDinhDanhCaNhan);
	CongDanDTO congDanDTO = null;
	String _trangThaiHoNhan ="";
	String _hoVaTen= "";
	String _quanHe = "";
	String _quocTich = "";
	String _soDinhDanhCaNhan = "";
	if(Validator.isNotNull(soDinhDanhCaNhan)){
		congDanDTO = CongDanDTOLocalServiceUtil.findBySoDinhDanhCaNhan(soDinhDanhCaNhan);
		if(Validator.isNotNull(congDanDTO)){
			//_trangThaiHoNhan = congDanDTO.getTinhTrangHonNhanId();
			TinhTrangHonNhan tinhTrangHonNhan = TinhTrangHonNhanLocalServiceUtil.findBySoDinhDanhCaNhan(congDanDTO.getSoDinhDanhCaNhan());
			if(Validator.isNotNull(tinhTrangHonNhan)){
				TrangThaiHonNhan trangThaiHonNhan = TrangThaiHonNhanLocalServiceUtil.findById(tinhTrangHonNhan.getDmdcTrangThaiHonNhanId());
				if(Validator.isNotNull(trangThaiHonNhan)){
					_trangThaiHoNhan = trangThaiHonNhan.getTenTrangThaiHonNhan();
				}
			}
			_hoVaTen = congDanDTO.getHoVaTen();
			QuanHeVoiChuHo quanHeVoiChuHo = QuanHeVoiChuHoLocalServiceUtil.findBySoDinhDanhCaNhan(soDinhDanhCaNhan);
			if(Validator.isNotNull(quanHeVoiChuHo)){
				QuanHeGiaDinh quanHeGiaDinh = QuanHeGiaDinhLocalServiceUtil.findById(quanHeVoiChuHo.getDmdcQuanHeGiaDinhId());
				if(Validator.isNotNull(quanHeGiaDinh)){
					_quanHe = quanHeGiaDinh.getTenQuanHeGiaDinh();
				}
			}
			_quocTich = congDanDTO.getQuocTich();
			_soDinhDanhCaNhan = congDanDTO.getSoDinhDanhCaNhan();
		}
	}
%>

<div id="<portlet:namespace/>tinh-trang-hon-nhan-content">
	<table class="gridnormal">
		<tr>
			<td>
				<liferay-ui:message key="tinh-trang-hon-nhan" />
			</td>
			<td>
				<%=_trangThaiHoNhan %>
			</td>
		</tr>

		<tr>
			<td>
				<liferay-ui:message key="ho-ten" />
			</td>
			<td>
				<%=_hoVaTen %>
			</td>
		</tr>
		
		<tr>
			<td>
				<liferay-ui:message key="quan-he" />
			</td>
			<td>
				<%=_quanHe %>
			</td>
		</tr>

		<tr>
			<td>
				<liferay-ui:message key="quoc-tich" />
			</td>
			<td>
				<%=_quocTich %>
			</td>
		</tr>

		<tr>
			<td>
				<liferay-ui:message key="so-dinh-danh-ca-nhan" />
			</td>
			<td>
				<%=_soDinhDanhCaNhan %>
			</td>
		</tr>
	</table>
</div>

<script type="text/javascript">
</script>